/*
 * Copyright (c) 2025 Huawei Technologies Co., Ltd.
 * openUBMC is licensed under Mulan PSL v2.
 * You can use this software according to the terms and conditions of the Mulan PSL v2.
 * You may obtain a copy of Mulan PSL v2 at:
 *         http://license.coscl.org.cn/MulanPSL2
 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
 * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
 * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
 * See the Mulan PSL v2 for more details.
 */

#include "mcpy/exception.h"

namespace mcpy {

// 实现 ValueError 异常
MC_IMPLEMENT_EXCEPTION_CLASS_BASE(value_error, value_error_code, "值错误", "ValueError", mc::exception);

// 实现 TypeError 异常
MC_IMPLEMENT_EXCEPTION_CLASS_BASE(type_error, type_error_code, "类型错误", "TypeError", mc::exception);

// 实现 IndexError 异常
MC_IMPLEMENT_EXCEPTION_CLASS_BASE(index_error, index_error_code, "索引错误", "IndexError", mc::exception);

// 实现 KeyError 异常
MC_IMPLEMENT_EXCEPTION_CLASS_BASE(key_error, key_error_code, "键错误", "KeyError", mc::exception);

// 实现 AttributeError 异常
MC_IMPLEMENT_EXCEPTION_CLASS_BASE(attribute_error, attribute_error_code, "属性错误", "AttributeError", mc::exception);

// 实现 NameError 异常
MC_IMPLEMENT_EXCEPTION_CLASS_BASE(name_error, name_error_code, "名称错误", "NameError", mc::exception);

// 实现 ZeroDivisionError 异常
MC_IMPLEMENT_EXCEPTION_CLASS_BASE(zero_division_error, zero_division_error_code, "除零错误", "ZeroDivisionError",
                                  mc::exception);

// 实现 OverflowError 异常
MC_IMPLEMENT_EXCEPTION_CLASS_BASE(overflow_error, overflow_error_code, "溢出错误", "OverflowError", mc::exception);

// 实现 RuntimeError 异常
MC_IMPLEMENT_EXCEPTION_CLASS_BASE(runtime_error, runtime_error_code, "运行时错误", "RuntimeError", mc::exception);

// 实现 NotImplementedError 异常
MC_IMPLEMENT_EXCEPTION_CLASS_BASE(not_implemented_error, not_implemented_error_code, "未实现错误",
                                  "NotImplementedError", mc::exception);

// 实现 StopIteration 异常
MC_IMPLEMENT_EXCEPTION_CLASS_BASE(stop_iteration, stop_iteration_code, "停止迭代", "StopIteration", mc::exception);

} // namespace mcpy
